home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 176-200 / disk_197 / stevie / help.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  8KB  |  308 lines

  1. /*
  2.  * STEVIE - Simply Try this Editor for VI Enthusiasts
  3.  *
  4.  * Code Contributions By : Tim Thompson           twitch!tjt
  5.  *                         Tony Andrews           onecom!wldrdg!tony 
  6.  *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  7.  */
  8.  
  9. #include "stevie.h"
  10.  
  11. extern char    *Version;
  12.  
  13. static int      helprow;
  14.  
  15. #ifdef    HELP
  16.  
  17. #ifdef    MEGAMAX
  18. overlay "help"
  19. #endif
  20.  
  21. static void     longline();
  22.  
  23. bool_t
  24. help()
  25. {
  26.     outstr(T_ED);
  27.     windgoto(helprow = 0, 0);
  28.  
  29.     longline("\
  30.    Positioning within file\n\
  31.    =======================\n\
  32.       ^F             Forward screenfull             Worked on by:\n\
  33.       ^B             Backward screenfull                Tim Thompson\n");
  34.     longline("\
  35.       ^D             scroll down half screen            Tony Andrews\n\
  36.       ^U             scroll up half screen              G.R. (Fred) Walter\n");
  37.     longline("\
  38.       G              Goto line (end default)\n\
  39.       ]]             next function\n\
  40.       [[             previous function\n\
  41.       /re            next occurence of regular expression 're'\n");
  42.     longline("\
  43.       ?re            prior occurence of regular expression 're'\n\
  44.       n              repeat last / or ?\n\
  45.       N              reverse last / or ?\n\
  46.       %              find matching (, ), {, }, [, or ]\n");
  47.     longline("\
  48. \n\
  49.    Adjusting the screen\n\
  50.    ====================\n\
  51.       ^L             Redraw the screen\n\
  52.       ^E             scroll window down 1 line\n\
  53.       ^Y             scroll window up 1 line\n");
  54.     longline("\
  55.       z<RETURN>      redraw, current line at top\n\
  56.       z-             ... at bottom\n\
  57.       z.             ... at center\n");
  58.  
  59.     windgoto(0, 32);
  60.     longline(Version);
  61. #ifdef AMIGA
  62.     longline(" ");
  63.     longline(__DATE__);
  64.     longline(" ");
  65.     longline(__TIME__);
  66. #endif
  67.  
  68.     windgoto(helprow = Rows - 2, 47);
  69.     longline("<Press space bar to continue>\n");
  70.     windgoto(helprow = Rows - 1, 47);
  71.     longline("<Any other key will quit>");
  72.  
  73.     if (vgetc() != ' ')
  74.     return TRUE;
  75.  
  76.     outstr(T_ED);
  77.     windgoto(helprow = 0, 0);
  78.  
  79.     longline("\
  80.    Character Positioning\n\
  81.    =====================\n\
  82.       ^              first non-white\n\
  83.       0              beginning of line\n\
  84.       $              end of line\n\
  85.       h              backward\n");
  86.     longline("\
  87.       l              forward\n\
  88.       ^H             same as h\n\
  89.       space          same as l\n\
  90.       fx             find 'x' forward\n");
  91.     longline("\
  92.       Fx             find 'x' backward\n\
  93.       tx             upto 'x' forward\n\
  94.       Tx             upto 'x' backward\n\
  95.       ;              Repeat last f, F, t, or T\n");
  96.     longline("\
  97.       ,              inverse of ;\n\
  98.       |              to specified column\n\
  99.       %              find matching (, ), {, }, [, or ]\n");
  100.  
  101.     windgoto(helprow = Rows - 2, 47);
  102.     longline("<Press space bar to continue>\n");
  103.     windgoto(helprow = Rows - 1, 47);
  104.     longline("<Any other key will quit>");
  105.  
  106.     if (vgetc() != ' ')
  107.     return TRUE;
  108.  
  109.     outstr(T_ED);
  110.     windgoto(helprow = 0, 0);
  111.  
  112.     longline("\
  113.     Line Positioning\n\
  114.     =====================\n\
  115.     H           home window line\n\
  116.     L           last window line\n\
  117.     M           middle window line\n");
  118.     longline("\
  119.     +           next line, at first non-white\n\
  120.     -           previous line, at first non-white\n\
  121.     CR          return, same as +\n\
  122.     j           next line, same column\n\
  123.     k           previous line, same column\n");
  124.  
  125.     longline("\
  126. \n\
  127.     Marking and Returning\n\
  128.     =====================\n\
  129.     ``          previous context\n\
  130.     ''          ... at first non-white in line\n");
  131.     longline("\
  132.     mx          mark position with letter 'x'\n\
  133.     `x          to mark 'x'\n\
  134.     'x          ... at first non-white in line\n");
  135.  
  136.     windgoto(helprow = Rows - 2, 47);
  137.     longline("<Press space bar to continue>\n");
  138.     windgoto(helprow = Rows - 1, 47);
  139.     longline("<Any other key will quit>");
  140.  
  141.     if (vgetc() != ' ')
  142.     return TRUE;
  143.  
  144.     outstr(T_ED);
  145.     windgoto(helprow = 0, 0);
  146.  
  147.     longline("\
  148.     Insert and Replace\n\
  149.     ==================\n\
  150.     a           append after cursor\n\
  151.     i           insert before cursor\n\
  152.     A           append at end of line\n\
  153.     I           insert before first non-blank\n");
  154.     longline("\
  155.     o           open line below\n\
  156.     O           open line above\n\
  157.     rx          replace single char with 'x'\n\
  158.     R           replace characters (not yet)\n\
  159.     ~           replace character under cursor with other case\n");
  160.  
  161.     longline("\
  162. \n\
  163.     Words, sentences, paragraphs\n\
  164.     ============================\n\
  165.     w           word forward\n\
  166.     b           back word\n\
  167.     e           end of word\n\
  168.     )           to next sentence (not yet)\n\
  169.     }           to next paragraph (not yet)\n");
  170.     longline("\
  171.     (           back sentence (not yet)\n\
  172.     {           back paragraph (not yet)\n\
  173.     W           blank delimited word\n\
  174.     B           back W\n\
  175.     E           to end of W");
  176.  
  177.     windgoto(helprow = Rows - 2, 47);
  178.     longline("<Press space bar to continue>\n");
  179.     windgoto(helprow = Rows - 1, 47);
  180.     longline("<Any other key will quit>");
  181.  
  182.     if (vgetc() != ' ')
  183.     return TRUE;
  184.  
  185.     outstr(T_ED);
  186.     windgoto(helprow = 0, 0);
  187.  
  188.     longline("\
  189.     Undo  &  Redo\n\
  190.     =============\n\
  191.     u           undo last change\n\
  192.     U           restore current line (not yet)\n\
  193.     .           repeat last change\n");
  194.  
  195.     longline("\
  196. \n\
  197.     File manipulation\n\
  198.     =================\n");
  199.     longline("\
  200.     :w          write back changes\n\
  201.     :wq         write and quit\n\
  202.     :x          write if modified, and quit\n\
  203.     :q          quit\n\
  204.     :q!         quit, discard changes\n\
  205.     :e name     edit file 'name'\n");
  206.     longline("\
  207.     :e!         reedit, discard changes\n\
  208.     :e #        edit alternate file\n\
  209.     :w name     write file 'name'\n");
  210.     longline("\
  211.     :n          edit next file in arglist\n\
  212.     :n args     specify new arglist (not yet)\n\
  213.     :rew        rewind arglist\n\
  214.     :f          show current file and lines\n");
  215.     longline("\
  216.     :f file     change current file name\n\
  217.     :ta tag     to tag file entry 'tag'\n\
  218.     ^]          :ta, current word is tag");
  219.  
  220.     windgoto(helprow = Rows - 2, 47);
  221.     longline("<Press space bar to continue>\n");
  222.     windgoto(helprow = Rows - 1, 47);
  223.     longline("<Any other key will quit>");
  224.  
  225.     if (vgetc() != ' ')
  226.     return TRUE;
  227.  
  228.     outstr(T_ED);
  229.     windgoto(helprow = 0, 0);
  230.  
  231.     longline("\
  232.     Operators (double to affect lines)\n\
  233.     ==================================\n\
  234.     d           delete\n\
  235.     c           change\n");
  236.     longline("\
  237.     <           left shift\n\
  238.     >           right shift\n\
  239.     y           yank to buffer\n");
  240.  
  241.     longline("\n\
  242.     Yank and Put\n\
  243.     ============\n\
  244.     p           put back text\n\
  245.     P           put before\n\
  246.     Y           yank lines");
  247.  
  248.     windgoto(helprow = Rows - 2, 47);
  249.     longline("<Press space bar to continue>\n");
  250.     windgoto(helprow = Rows - 1, 47);
  251.     longline("<Any other key will quit>");
  252.  
  253.     if (vgetc() != ' ')
  254.     return TRUE;
  255.  
  256.     outstr(T_ED);
  257.     windgoto(helprow = 0, 0);
  258.  
  259.     longline("\n\
  260.     Miscellaneous operations\n\
  261.     ========================\n\
  262.     C           change rest of line\n\
  263.     D           delete rest of line\n\
  264.     s           substitute chars\n");
  265.     longline("\
  266.     S           substitute lines (not yet)\n\
  267.     J           join lines\n\
  268.     x           delete characters\n\
  269.     X           ... before cursor\n\
  270.     :[range]s/search/replace/[g]\n\
  271.     :[range]g/search[/p|/d]\n\
  272.     :[range]d   delete range of lines\n");
  273.  
  274.     windgoto(helprow = Rows - 1, 47);
  275.     longline("<Press any key>");
  276.  
  277.     vgetc();
  278.  
  279.     return TRUE;
  280. }
  281.  
  282. static void
  283. longline(p)
  284.     char           *p;
  285. {
  286. # ifdef AMIGA
  287.     outstr(p);
  288. # else
  289.     char           *s;
  290.  
  291.     for (s = p; *s; s++) {
  292.     if (*s == '\n')
  293.         windgoto(++helprow, 0);
  294.     else
  295.         outchar(*s);
  296.     }
  297. # endif
  298. }
  299. #else
  300.  
  301. bool_t
  302. help()
  303. {
  304.     msg("Sorry, help not configured");
  305.     return FALSE;
  306. }
  307. #endif
  308.